<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It is a breeze. Simply tell Lumen the URIs it should respond to
| and give it the Closure to call when that URI is requested.
|
*/

$api = app('Dingo\Api\Routing\Router');


$api->group(['version' => 'v1', 'namespace' => 'App\Http\Controllers'], function () use ($api) {

    $routes = __DIR__.'/../routes/';

    require $routes . 'common.php';

    //后台用户路由
    $admin_routes = [
        'prefix' => 'admin',
        'namespace' => 'Admin',
    ];

    $api->group($admin_routes, function ($api) use ($routes) {

        //后台用户认证类
        require $routes . 'Admin/auth.php';
    });

    //小程序路由
    $weapp_routes = [
        'prefix' => 'weapp',
        'namespace' => 'Weapp',
    ];

    $api->group($weapp_routes, function ($api) use($routes){

        //小程序登录
        require $routes . 'Weapp/login.php';
    });

});
